package tfts

type Role int

const (
	TestRole Role = iota
	Caster
	MarkMan
	Assassin
	Warrior
	Tank
)

func (f *Form) ApplyRole() {
	switch f.Role {
	case Caster:
		f.Caster()
	case MarkMan:
		f.MarkMan()
	case Assassin:
		f.Assassin()
	case Warrior:
		f.Warrior()
	case Tank:
		f.Tank()
	case TestRole:
		f.Add(HitMana(10))
	}
}

func (f *Form) Tank() *Form {
	f.Add(HitMana(5))
	f.beaten()
	return f
}

func (f *Form) Caster() *Form {
	f.Add(HitMana(7))
	f.Add(Regen(2))
	return f
}

func (f *Form) Assassin() *Form {
	f.Add(HitMana(10))
	return f
}

func (f *Form) Warrior() *Form {
	f.Add(AS(25))
	f.Add(HitMana(10))
	return f
}

func (f *Form) MarkMan() *Form {
	f.Add(HitMana(10))
	return f
}

func (f *Form) beaten() {
	if !f.isFighter() || !beatenManaEnable || f.ManaLess {
		return
	}
	f.attached.FormAction(f.name).Repeat(1).On(TimeGoE).AddCall("挨打回蓝", func(fight *Fight) {
		if !fight.lockMana() {
			fight.mana += beatenMana * fight.manaAmp()
		}
	})
}
